home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-11-08 | 3.3 KB | 131 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: EmbedPxy.cpp
- // Release Version: $ 1.0d11 $
- //
- // Copyright: © 1995 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #include "Embed.hpp"
-
- // ----- Embed Part Includes -----
-
- #ifndef EMBEDPROXY_H
- #include "EmbedPxy.h"
- #endif
-
- #ifndef EMBEDPART_H
- #include "EmbedPar.h"
- #endif
-
- // ----- ODF Includes -----
-
- #ifndef FWFRMING_H
- #include "FWFrming.h"
- #endif
-
- #ifndef FWUTIL_H
- #include "FWUtil.h"
- #endif
-
- #ifndef FWPRESEN_H
- #include "FWPresen.h"
- #endif
-
- #ifndef FWFCTCLP_H
- #include "FWFctClp.h"
- #endif
-
- // ----- OS Layer -----
-
- #ifndef FWODGEOM_H
- #include "FWODGeom.h"
- #endif
-
- // ----- OpenDoc Includes -----
-
- #ifndef SOM_ODShape_xh
- #include <Shape.xh>
- #endif
-
- #ifndef SOM_ODTransform_xh
- #include <Trnsform.xh>
- #endif
-
- #ifndef SOM_ODSession_xh
- #include <ODSessn.xh>
- #endif
-
- //========================================================================================
- // RunTime Info
- //========================================================================================
-
- #ifdef FW_BUILD_MAC
- #pragma segment odfembed
- #endif
-
- //========================================================================================
- // class CEmbedProxy
- //========================================================================================
-
- //----------------------------------------------------------------------------------------
- // CEmbedProxy constructors
- //----------------------------------------------------------------------------------------
-
- CEmbedProxy::CEmbedProxy(Environment* ev, CEmbedPart* part) :
- FW_MProxy(ev, part, part->GetMainPresentation(ev)),
- fPart(part)
- {
- }
-
- //----------------------------------------------------------------------------------------
- // CEmbedProxy::~CEmbedProxy
- //----------------------------------------------------------------------------------------
-
- CEmbedProxy::~CEmbedProxy()
- {
- }
-
- //----------------------------------------------------------------------------------------
- // CEmbedProxy::UsedShapeChanged
- //----------------------------------------------------------------------------------------
- // Used shape of an embedded frame changed. Just invalidate
-
- void CEmbedProxy::UsedShapeChanged(Environment* ev,
- FW_CEmbeddingFrame* embeddingFrame,
- ODFrame* odEmbeddedFrame)
- {
- FW_UNUSED(odEmbeddedFrame);
-
- embeddingFrame->Invalidate(ev);
-
- // ----- Recalculate the clip -----
- FW_CFacetClipper clipper(ev, fPart);
- clipper.Clip(ev, embeddingFrame);
- }
-
- //----------------------------------------------------------------------------------------
- // CEmbedProxy::FrameShapeRequested
- //----------------------------------------------------------------------------------------
- // We always want the embedded frame to have our frame shape
-
- ODShape* CEmbedProxy::FrameShapeRequested(Environment* ev,
- ODFrame* odEmbeddedFrame,
- ODShape* askedFrameShape)
- {
- FW_UNUSED(askedFrameShape);
-
- FW_CRect rect;
-
- FW_CAcquiredODFrame aqContainingFrame = odEmbeddedFrame->AcquireContainingFrame(ev);
- FW_CEmbeddingFrame* embeddingFrame = FW_CEmbeddingFrame::ODtoFWEmbeddingFrame(ev, aqContainingFrame);
-
- rect = embeddingFrame->GetBounds(ev);
-
- ODShape* frameShape = ::FW_NewODShape(ev, rect); // No FW_CAcquiredODShape because we are returning it
- return frameShape;
- }
-
-
-